#define _CRT_SECURE_NO_WARNINGS 1
#include <vector>
#include <climits>
using namespace std;
class Solution {
public:
    int getDis(vector<int>& A, int n)
    {
        int Min = A[0];
        int Max = INT_MIN;
        for (int i = 0;i < n;i++)
        {
            if (A[i] < Min)
            {
                Min = A[i];
            }
            if (A[i] - Min > Max)
            {
                Max = A[i] - Min;
            }
        }
        return Max;
    }
};